/*
* @Author: karry
* @Date:   2019-08-03 15:40:31
* @Last Modified by:   karry
* @Last Modified time: 2019-08-03 15:40:31
*/
import React 	 		from 'react';
import { BrowserRouter as Router, Switch, Redirect, Route, Link } from 'react-router-dom';
import ProdcutList 	 	from 'page/product/index/index.jsx';
import ProdcutSave 	 	from 'page/product/index/save.jsx';
import ProdcutDetail 	from 'page/product/index/detail.jsx';
import CategoryList 	from 'page/product/category/index.jsx';
import CategoryAdd 	from 'page/product/category/add.jsx';

class ProductRouter extends React.Component{
	render(){
		return(
			<Switch>
				<Route  path="/product/index" component={ProdcutList} />
				<Route  path="/product/save/:pid?" component={ProdcutSave} />
				<Route  path="/product/detail/:pid" component={ProdcutDetail} />
				<Route  path="/product-category/index/:categoryId?" component={CategoryList} />
				<Route  path="/product-category/add" component={CategoryAdd} />
				
				<Redirect exact path="/product" to="/product/index" />
				<Redirect exact path="/product-category" to="/product-category/index" />
			</Switch>
		)
	}
}

export default ProductRouter;